load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "acl",
    srcs = [
        "access_control.go",
        "allowlist.go",
        "cidr_ranges.go",
        "denylist.go",
        "file.go",
        "private_endpoints.go",
        "watcher.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/sqlproxyccl/acl",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/ccl/sqlproxyccl/tenant",
        "//pkg/roachpb",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_google_btree//:btree",
        "@com_github_pires_go_proxyproto//:go-proxyproto",
        "@com_github_pires_go_proxyproto//tlvparse",
        "@in_gopkg_yaml_v2//:yaml_v2",
    ],
)

go_test(
    name = "acl_test",
    srcs = [
        "cidr_ranges_test.go",
        "file_test.go",
        "private_endpoints_test.go",
        "watcher_test.go",
    ],
    embed = [":acl"],
    deps = [
        "//pkg/ccl/sqlproxyccl/tenant",
        "//pkg/ccl/sqlproxyccl/tenantdirsvr",
        "//pkg/roachpb",
        "//pkg/testutils",
        "//pkg/util/leaktest",
        "//pkg/util/metric",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_google_btree//:btree",
        "@com_github_pires_go_proxyproto//:go-proxyproto",
        "@com_github_pires_go_proxyproto//tlvparse",
        "@com_github_stretchr_testify//require",
        "@in_gopkg_yaml_v2//:yaml_v2",
    ],
)
